


<%@ page import="gestorcondominio.Residentes" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'residentes.label', default: 'Residentes')}" />
<title><g:message code="default.edit.label" args="[entityName]" />
</title>
</head>
<body>
	<div class="nav">
		<span class="menuButton"><a class="home"
			href="${createLink(uri: '/')}"><g:message
					code="default.home.label" />
		</a>
		</span> <span class="menuButton"><g:link class="list" action="list">
				<g:message code="default.list.label" args="[entityName]" />
			</g:link>
		</span> <span class="menuButton"><g:link class="create"
				action="create">
				<g:message code="default.new.label" args="[entityName]" />
			</g:link>
		</span>
	</div>
	<div class="body">
		<h1>
			<g:message code="default.edit.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message">${flash.message}</div>
		</g:if>
		<g:hasErrors bean="${residentesInstance}">
			<div class="errors">
				<g:renderErrors bean="${residentesInstance}" as="list" />
			</div>
		</g:hasErrors>
		<g:form method="post"
			>
			<g:hiddenField name="id" value="${residentesInstance?.id}" />
			<g:hiddenField name="version" value="${residentesInstance?.version}" />
			<div class="dialog">
				<table>
					<tbody>
						
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="coDocumento"><g:message code="residentes.coDocumento.label" default="Co Documento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'coDocumento', 'errors')}">
                                    <g:textField name="coDocumento" maxlength="20" value="${residentesInstance?.coDocumento}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="noTipoDocumento"><g:message code="residentes.noTipoDocumento.label" default="No Tipo Documento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'noTipoDocumento', 'errors')}">
                                    <g:select name="noTipoDocumento" from="${residentesInstance.constraints.noTipoDocumento.inList}" value="${residentesInstance?.noTipoDocumento}" valueMessagePrefix="residentes.noTipoDocumento"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="noNombres"><g:message code="residentes.noNombres.label" default="No Nombres" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'noNombres', 'errors')}">
                                    <g:textField name="noNombres" maxlength="40" value="${residentesInstance?.noNombres}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="noApellidos"><g:message code="residentes.noApellidos.label" default="No Apellidos" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'noApellidos', 'errors')}">
                                    <g:textField name="noApellidos" maxlength="40" value="${residentesInstance?.noApellidos}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="nuEdad"><g:message code="residentes.nuEdad.label" default="Nu Edad" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'nuEdad', 'errors')}">
                                    <g:textField name="nuEdad" value="${fieldValue(bean: residentesInstance, field: 'nuEdad')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="noCorreo"><g:message code="residentes.noCorreo.label" default="No Correo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'noCorreo', 'errors')}">
                                    <g:textField name="noCorreo" value="${residentesInstance?.noCorreo}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="viviendas"><g:message code="residentes.viviendas.label" default="Viviendas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'viviendas', 'errors')}">
                                    
<ul>
<g:each in="${residentesInstance?.viviendas?}" var="v">
    <li><g:link controller="viviendas" action="show" id="${v.id}">${v?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="viviendas" action="create" params="['residentes.id': residentesInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'viviendas.label', default: 'Viviendas')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="login"><g:message code="residentes.login.label" default="Login" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'login', 'errors')}">
                                    <g:textField name="login" value="${residentesInstance?.login}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="password"><g:message code="residentes.password.label" default="Password" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'password', 'errors')}">
                                    <g:passwordField name="password" value="${residentesInstance?.password}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="role"><g:message code="residentes.role.label" default="Role" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: residentesInstance, field: 'role', 'errors')}">
                                    <g:select name="role" from="${residentesInstance.constraints.role.inList}" value="${residentesInstance?.role}" valueMessagePrefix="residentes.role"  />
                                </td>
                            </tr>
                        
					</tbody>
				</table>
			</div>
			<div class="buttons">
				<span class="button"><g:actionSubmit class="save"
						action="update"
						value="${message(code: 'default.button.update.label', default: 'Update')}" />
				</span> <span class="button"><g:actionSubmit class="delete"
						action="delete"
						value="${message(code: 'default.button.delete.label', default: 'Delete')}"
						onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</span>
			</div>
		</g:form>
	</div>
</body>
</html>
